<template>
    <div class="content" @contextmenu.prevent="">
        <Back></Back>
		<Battery></Battery>
		<Title v-bind:hasHelp="false" v-bind:title="this.$route.params.title"></Title>
        	<div class="spare-a" id="container">
			<div class="questions-ar">
				<div class="spare-ara">
					<div class="spare-ara-a clearfix">
						<div class="spare-ara-al">
							<div class="spare-ara-all"><input type="text" placeholder="请输入关键字" v-model="name"/></div>
							<div class="spare-ara-alr" @click="getMedias(name)"></div>
						</div>
					</div>
					<div class="documentation paper">
					  <ul>
					  	<a href="#"  v-for="media in medias" :key="media.id" >
						<li   v-for="media in medias" :key="media" @click="mediaShow(media.url,media.title)">
                                <div class="paper-a">标题：{{media.title}}</div>
                                <div class="multimedia-a">ICN编码：{{media.code}}</div>
                                <div class="multimedia-a">数据模块编码：{{media.dmCode}}</div>
						</li>
						</a>
					  </ul>
					</div>
				</div>
			</div>
		
		</div>
    </div>
</template>

<script>
import Battery from "@/components/Battery";
import Title from "@/components/Title";
import Back from '@/components/Back'
import MediaShow from '@/components/ietm/MediaShow'
export default {
    name:"media",
    data() {
        return {
        medias: [],
        name:'',
        url:'',
        title:'',
        flag:true
        }
    },
    components:{
        Battery,
	    Title,
        Back,
        MediaShow
    },
    methods:{
        getMedias:function(name){
            this.axios.get("/ietm/multimedia",{
                params:{
                    name:name
                }
            }).then(res=>{
                 this.medias = res.data;
             });
        },
        mediaShow:function(url,title){
            this.url=url;
            this.title=title;
            this.flag=true;
          	window.open (url,'swf','height=400,width=640,top=0,left=0,toolbar=no,menubar=no,scrollbars=no,titlebar=no,resizable=yes,location=no,status=no,fullscreen=1') 
            /*this.$layer.iframe({
                    content: {
                    content: MediaShow, //传递的组件对象
                    parent: this,//当前的vue对象
                    data:{'url':url,'title':title}//props
                    },
                    area:'auto',
                    title:"Media",
                    maxmin:true
                });*/
        }
    },
    created(){
        this.getMedias('');
    }
};
</script>
<style scoped>
@import url('../../assets/css/content.css');
@import url('../../assets/css/animation.css');
</style>